package com.qumitech.visualnovel.controller.rest;


import com.qumitech.visualnovel.model.common.BaseRsp;
import com.qumitech.visualnovel.pubdef.dto.a8game.A8GameSpecificLimitConfigQueryAdminDTO;
import com.qumitech.visualnovel.pubdef.dto.a8game.A8GameSpecificLimitConfigRevokeAdminDTO;
import com.qumitech.visualnovel.pubdef.dto.a8game.A8GameSpecificLimitNewAdminDTO;
import com.qumitech.visualnovel.service.a8game.A8GameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/api/a8/game")
public class A8GameController {

    @Autowired
    private A8GameService a8GameAdminService;


    // @RequireWhiteList
    @PostMapping("/limit")
    public BaseRsp saveSpecificLimit(@RequestBody A8GameSpecificLimitNewAdminDTO dto) {
        return a8GameAdminService.saveSpecificLimit(dto);
    }

    // @RequireWhiteList
    @GetMapping("/limit")
    public BaseRsp getSpecificLimit(A8GameSpecificLimitConfigQueryAdminDTO queryAdminDTO) {
        return a8GameAdminService.getSpecificLimit(queryAdminDTO);
    }

    //   @RequireWhiteList
    @PutMapping("/limit/{id}")
    public BaseRsp rmSpecificLimit(@RequestBody A8GameSpecificLimitConfigRevokeAdminDTO revokeAdminDTO,
                                   @PathVariable(name = "id") Long id) {
       return a8GameAdminService.rmSpecificLimit(revokeAdminDTO, id);
    }

}